import axios from "axios";

const BASE_URL = '/api'

export const request = async (url, method = "GET", data = {}) => {
    let result = await axios.request({
        url: BASE_URL + url,
        method,
        data,
        headers: {
            "TOKEN": window.localStorage.getItem("token")
        }
    })
    if (result?.status === 200) {
        return result?.data;
    }
    return -1
}

